<?php

// use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitOrderCodeRecords extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_code_records', function (Blueprint $table) {
            $table->comment = '订单核销记录表';
            
            $table->increments('id');
            $table->uuid('uuid')->index() ;

            $table->integer('order_id')->unsigned()->index()->comment('订单id'); //订单id
            $table->integer('admin_id')->unsigned()->index()->comment('管理员id'); //管理员id

            $table->string('location', 100)->nullable()->comment('核销地点');
            $table->string('remark', 100)->nullable()->comment('备注');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('order_code_records');
    }
}
